﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MJM.Principal;

namespace wRegPadron
{
    /// <summary>
    /// Descripción breve de ghFotoEmp
    /// </summary>
    public class ghFotoEmp : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "image/jpeg";
            string idString = context.Request.QueryString["ID"];
            if (!String.IsNullOrEmpty(idString))
            {
                
                byte[] img = MediadorCN.GetPersona().ObtenerFoto(Convert.ToInt32(idString));
                if (img != null)
                {
                    context.Response.BinaryWrite(img);
                }
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}